package com.leo;

import javafx.application.Application;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
 * @ClassName SecondStage
 * @Description 窗口类型
 * @Author wangss
 * @date 2020.05.15 23:55
 * @Version 1.0
 */
public class SecondStageType extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Stage stage1 = new Stage();
        stage1.setTitle("stage1");
        // 窗口类型：默认
        stage1.initStyle(StageStyle.DECORATED);
        stage1.show();

        Stage stage2 = new Stage();
        stage2.setTitle("stage2");
        // 定义一个白色背景的窗口，透明窗口
        stage2.initStyle(StageStyle.TRANSPARENT);
        stage2.show();

        Stage stage3 = new Stage();
        stage3.setTitle("stage3");
        // 透明窗口
        stage3.initStyle(StageStyle.UNDECORATED);
        stage3.show();

        Stage stage4 = new Stage();
        stage4.setTitle("stage4");
        // 没有标题栏，和第一个效果差不多
        stage4.initStyle(StageStyle.UNIFIED);
        stage4.show();

        Stage stage5 = new Stage();
        stage5.setTitle("stage5");
        // 对话框，没有最大最小化
        stage5.initStyle(StageStyle.UTILITY);
        stage5.show();

        // 退出进程
//        Platform.exit();
    }
}
